package com.jianying.mapper;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.jianying.base.BaseMapper;
import com.jianying.dataSource.TargetDataSource;
import com.jianying.domain.Tenant;

@Repository("tenantMapper")
public class TenantMapper extends BaseMapper {

	private static final String NAME_SPACE = "com.jianying.mapper.TenantMapper.";
	
	@TargetDataSource(name="ds1")
	public void insert(Tenant tenant){
		getSqlSessionTemplate().insert(NAME_SPACE + "insert", tenant);
	}
	
//	@TargetDataSource(name="ds1")
	public Tenant findById(Integer id){
		return getSqlSessionTemplate().selectOne(NAME_SPACE + "findById", id);
	}
	
	public List<Tenant> all(){
		return getSqlSessionTemplate().selectList(NAME_SPACE + "all");
	}
}
